<template>
  <div id="index" ref="appRef">
    <div class="bg">
      <dv-loading v-if="loading">Loading...</dv-loading>
      <div v-else class="host-body">
        <div class="d-flex jc-center">
          <dv-decoration-10 class="dv-dec-10" />
          <div class="d-flex jc-center">
            <dv-decoration-8 class="dv-dec-8" :color="decorationColor" />
            <div class="title">
              <span class="title-text">试验平台</span>
              <dv-decoration-6
                class="dv-dec-6"
                :reverse="true"
                :color="['#50e3c2', '#67a1e5']"
              />
            </div>
            <dv-decoration-8
              class="dv-dec-8"
              :reverse="true"
              :color="decorationColor"
            />
          </div>
          <dv-decoration-10 class="dv-dec-10-s" />
        </div>

        <!-- 第二行 -->
        <div class="d-flex jc-between px-2">
          <div class="d-flex aside-width">
            <div class=" ml-4">
<!--              <span class="react-left"></span>
              <span class="text">数据分析1</span>
              -->
            </div>
            <div class=" ml-3">
<!--              <span class="text">数据分析2</span>-->
            </div>
          </div>
          <div class="d-flex aside-width">
            <div class="react-right  mr-3">
<!--              <span class="text fw-b">vue-big-screen</span>-->
              <span class="text fw-b"></span>
            </div>
            <div class="react-right mr-4">
<!--              <span class="react-after"></span>-->
              <span class="text"
                >{{ dateYear }} {{ dateWeek }} {{ dateDay }}</span
              >
            </div>
          </div>
        </div>

        <div class="body-box">
          <!-- 第三行数据 -->
          <div class="content-box">
            <div>
              <dv-border-box-11 title="辐照实验执行情况">
                <div class="dashboard-border-radius">
                  <!--          <circular-diagram />-->
                  <basic-nightingale-rose backgroundColor="" height="400px" width="600px"/>
                </div>
              </dv-border-box-11>
            </div>
            <div>
              <dv-border-box-11 title="试验运行情况">
                <div style="height: 450px;width:800px;padding: 80px 20px 0 20px;">
                  <el-row :gutter="32">
                    <el-col :xs="24" :sm="24" :lg="8">
                      <div class="dashboard-border-radius" style="padding: 10px">
                        <dv-border-box-12>
                          <el-row :gutter="20">
                            <el-col :xs="24" :sm="24" :lg="12">
                              <div class="center_chart_text">
                                计划运行炉段:
                              </div>
                            </el-col>
                            <el-col :xs="24" :sm="24" :lg="12">
                              <CenterChart
                                  :id="rate[0].id"
                                  :tips="rate[0].tips"
                                  :colorObj="rate[0].colorData"
                              />
                            </el-col>
                          </el-row>
                        </dv-border-box-12>
                      </div>
                    </el-col>
                    <el-col :xs="24" :sm="24" :lg="8">
                      <div class="dashboard-border-radius">
                        <dv-border-box-12>
                          <el-row :gutter="20">
                            <el-col :xs="24" :sm="24" :lg="12">
                              <div class="center_chart_text">
                                已执行炉段:
                              </div>
                            </el-col>
                            <el-col :xs="24" :sm="24" :lg="12">
                              <CenterChart
                                  :id="rate[1].id"
                                  :tips="rate[1].tips"
                                  :colorObj="rate[1].colorData"
                              />
                            </el-col>
                          </el-row>
                        </dv-border-box-12>
                      </div>
                    </el-col>
                    <el-col :xs="24" :sm="24" :lg="8">
                      <div class="dashboard-border-radius">
                        <dv-border-box-12>
                          <el-row :gutter="20">
                            <el-col :xs="24" :sm="24" :lg="12">
                              <div class="center_chart_text">
                                剩余执行炉段:
                              </div>
                            </el-col>
                            <el-col :xs="24" :sm="24" :lg="12">
                              <CenterChart
                                  :id="rate[2].id"
                                  :tips="rate[2].tips"
                                  :colorObj="rate[2].colorData"
                              />
                            </el-col>
                          </el-row>
                        </dv-border-box-12>
                      </div>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-row>
                      <div style="height: 40px;text-align: center;line-height: 40px; color: white;font-weight: bold; ">
                        <span>试验指标</span>
                      </div>
                    </el-row>
                    <el-row>
                      <el-form ref="loginForm" label-width="100px">
                        <el-form-item prop="name1">
                    <span slot="label">
                     <span style="color: white"><strong>试验目标湿度</strong>      </span>
                   </span>
                          <el-input v-model="loginForm.name1" style="width: 98%"></el-input>
                        </el-form-item>
                        <el-form-item  prop="name2">
                      <span slot="label">
                       <span style="color: white"><strong>试验目标注量</strong>      </span>
                     </span>
                          <el-input v-model="loginForm.name2" style="width: 98%"></el-input>
                        </el-form-item>
                        <el-form-item prop="name3">
                    <span slot="label">
                     <span style="color: white"><strong>试验目标消耗</strong>      </span>
                   </span>
                          <el-input v-model="loginForm.name3" style="width: 98%"></el-input>
                        </el-form-item>
                      </el-form>
                    </el-row>
                  </el-row>
                </div>
              </dv-border-box-11>
            </div>
            <!-- 中间 -->
<!--            <div>
              <center />
            </div>-->
            <!-- 中间 -->
<!--            <div>
              <centerRight2 />
            </div>-->
            <div>
              <dv-border-box-11 title="辐照资源使用情况">
                <centerRight1 />
              </dv-border-box-11>
            </div>
          </div>

          <!-- 第四行数据 -->
          <div class="bottom-box">
            <dv-border-box-13>
              <div style="margin: 20px 20px;">
<!--              <funnel3d-chart background-color=""></funnel3d-chart>-->
<!--                <histogram height="420px" background-color=""></histogram>-->
              </div>
            </dv-border-box-13>
            <dv-border-box-11 title ="辐照实验全年计划">
              <div style="margin: 20px 20px;">
               <bottomLeft/>
              </div>
            </dv-border-box-11>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import drawMixin from "../utils/drawMixin";
import { formatTime } from '../utils/index.js'
import centerRight1 from './centerRight1'
import bottomLeft from './bottomLeft'
import bottomRight from './bottomRight'
import BasicNightingaleRose from '../components/dashboard/BasicNightingaleRose'
import CenterChart from '../components/echart/center/centerChartRate'

import Funnel3dChart from '../components/dashboard/Funnel3dChart'
import Histogram from '../components/dashboard/Histogram'
import DynamicBarChart from '../components/dashboard/DynamicBarChart'
export default {
  mixins: [ drawMixin ],
  data() {
    return {
      timing: null,
      loading: true,
      dateDay: null,
      dateYear: null,
      dateWeek: null,
      weekday: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
      decorationColor: ['#568aea', '#000000'],
      rate: [
        {
          id: 'centerRate1',
          tips: 60,
          colorData: {
            textStyle: '#3fc0fb',
            series: {
              color: ['#00bcd44a', 'transparent'],
              dataColor: {
                normal: '#03a9f4',
                shadowColor: '#97e2f5'
              }
            }
          }
        },
        {
          id: 'centerRate2',
          tips: 40,
          colorData: {
            textStyle: '#67e0e3',
            series: {
              color: ['#faf3a378', 'transparent'],
              dataColor: {
                normal: '#ff9800',
                shadowColor: '#fcebad'
              }
            }
          }
        },
        {
          id: 'centerRate4',
          tips: 70,
          colorData: {
            textStyle: '#67e0e3',
            series: {
              color: ['#faf3a378', 'transparent'],
              dataColor: {
                normal: '#ff9800',
                shadowColor: '#fcebad'
              }
            }
          }
        }
      ],
      loginForm:{
        name1:'',
        name2:'',
        name3:''
      }
    }
  },
  components: {
    centerRight1,
    bottomLeft,
    BasicNightingaleRose,
    CenterChart
  },
  mounted() {
    this.timeFn()
    this.cancelLoading()
  },
  beforeDestroy () {
    clearInterval(this.timing)
  },
  methods: {
    timeFn() {
      this.timing = setInterval(() => {
        this.dateDay = formatTime(new Date(), 'HH: mm: ss')
        this.dateYear = formatTime(new Date(), 'yyyy-MM-dd')
        this.dateWeek = this.weekday[new Date().getDay()]
      }, 1000)
    },
    cancelLoading() {
      setTimeout(() => {
        this.loading = false
      }, 500)
    }
  }
}
</script>

<style lang="scss" scoped>
@import '../assets/scss/index.scss';
.center_chart_text{
  height: 100px;
  line-height: 100px;
  text-align: left;
  font-size: 16px;
  font-weight: bold;
  color: white;
  padding-left: 10px;
  width: 150px;
}
.el-input__inner{
  width: 80%;
}
</style>
